<template>
	<view>
		<u-navbar :title="`${$z.$t('我的收藏')}(${list.length})`"></u-navbar>
		<view v-for="(item, index) in list" :key="index" style="padding: 10rpx 32rpx">
			<caritem :item="item"></caritem>
		</view>
		<view v-if="list.length==0" class="u-flex" style="justify-content: center;height: 60vh;flex-direction: column;">
			<u--image :showLoading="true"
				src="http://img.gpsserver.cn:20080/240605/060510131017175_240605101310_Dj27aCDwrew2kKQQNxweH65zHCHimPHM.png"
				width="254rpx" height="240rpx" mode="widthFix" style="margin: 0" radius="20rpx"></u--image>
			<view class="u-flex" style="color: #a7b6c4;height: 100rpx;font-size: 32rpx;">
				{{$z.$t("暂无收藏电站哦~")}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		mounted() {
			this.init()
		},
		methods: {
			async init() {
				let SiteOften = await this.$z.request("/SiteOften")
				let list = []
				for (let i = 0; i < SiteOften.length; i++) {
					let StationCar = await this.$z.request("/StationCar", {
						id: SiteOften[i].pcs
					})
					list = list.concat(StationCar)
				}
				this.list = list;
			}
		}
	}
</script>

<style>

</style>